package com.google.code.fluentjoiner;

import com.google.common.base.Function;

public class FunctionCallable<T, U> implements SerializableCallable<U>
{
    private final T originValue;
    private final Function<? super T, U> function;

    public FunctionCallable(final T originValue, final Function<? super T, U> function)
    {
        this.originValue = originValue;
        this.function = function;
    }

    @Override
    public U call() throws Exception
    {
        return function.apply(originValue);
    }
}